/** 
 * @CopyRight (c) 2012-2012
 * @Project <eshop>
 * @JDK_Version_Used:<JDK1.6>
 * @Description:TODO<描述用途>
 * @Title: AdminJump.java
 * @Author: <何俊>
 * @Author_of_Contact <E:azj1001@sina.com T:18651831939>
 * @Date 2012-12-11 下午10:15:31
 * @Modified_By: <修改人>
 * @Modified_of_Contact <修改人联系方式>
 * @Modified_Date <修改日期时间>
 * @Why & What is modified <修改原因描述>
 * @Version v1.00
 */ 
package com.e.buy.web.impl;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.e.buy.BuyTools;
import com.e.buy.enums.Commons;

/**
 * @Description:(统一的部分内部跳转)
 * @author <何俊>
 * @date 2012-12-11 下午10:15:31
 * @version v1.0
 * @Other :@see #Files
 */
@Controller
public class AdminJump extends BuyTools {

//	@Resource
//	private CommonsServiceClient commons = null;

//	public void setCommons(CommonsServiceClient commons) {
//		this.commons = commons;
//	}

	/**
	 * @Description:<内部统一跳转>
	 * @title: jumpPage
	 * @param st ：标识
	 * @param spt ：简单参数
	 * @param session
	 * @return ModelAndView 返回类型
	 * @throws
	 */
	@RequestMapping("/innerJump.adm")
	public ModelAndView jumpPage(@RequestParam("st") String st,@RequestParam("spt") String spt,HttpSession session) {
		ModelAndView mv = new ModelAndView();
		Commons.BackProcess e = Commons.getBackProcess(st);
		String viewName = this.getWebProperties("web", e.getStatus() + ".page");
		switch (e) {
		case GOODS_CATEGROY_PROPERTIES:
			mv.addObject("categroyId",spt);
			break;
		case GOODS:
			//add,modify
			String[] splits = spt.split(",");
			mv.addObject("status",splits[0].toUpperCase());
			mv.addObject("menuId",splits[1]);
			break;
		case GOODS_STEP_0:
			viewName = "dispatch.adm?url=/dispatch.adm&p="+viewName+"&menuId="+spt;
			break;
		default:
			break;
		}
		mv.setViewName(viewName);
		return mv;
	}
}
